package com.springboot.pipeline.service.imp;

import com.springboot.pipeline.entity.InstanceBuildContext;
import com.springboot.pipeline.entity.PipelineContext;
import com.springboot.pipeline.executor.PipelineExecutor;
import com.springboot.pipeline.service.ModelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.function.BiConsumer;

@Component
public class ModelServiceImpl implements ModelService {



    @Resource
    private PipelineExecutor pipelineExecutor;
    /**
     * 提交模型（构建模型实例）
     */
    @Override
    public void buildModelInstance() {
        InstanceBuildContext data = new InstanceBuildContext();
        boolean success = pipelineExecutor.acceptSync(data);
        // 创建模型实例成功
        if (success) {
            System.out.println("成功");
        }else {
            System.out.println("失败");
        }
    }
}